<template>
  <div v-show="!loading" class="pagination-container">
    <el-pagination
      :current-page="currentPage"
      :page-sizes="pageSizes"
      :page-size="limit"
      :total="total"
      layout="total, sizes, prev, pager, next, jumper"
      @size-change="handlePageSizeChange"
      @current-change="handlePageChange"
    />
  </div>
</template>
<script>
export default {
  props: {
    currentPage: {
      type: Number,
      default: 1
    },
    limit: {
      type: Number,
      default: 20
    },
    pageSizes: {
      type: Array,
      default: function() {
        return [10, 20, 30, 50, 100, 500, 800]
      }
    },
    total: {
      type: Number,
      default: 0
    },
    loading: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    handlePageChange(val) {
      this.$emit('handleCurrentChange', val)
    },
    handlePageSizeChange(val) {
      this.$emit('handleSizeChange', val)
    }

    // handlePageChange2(val) {
    //   this.$emit('handleCurrentChange2', val)
    // },
    // handlePageSizeChange2(val) {
    //   this.$emit('handleSizeChange2', val)
    // }
  }
}
</script>
